import plotly.plotly as py
import plotly.figure_factory as ff


import numpy as np
#画聚类的树状图（并为画成）
import chart_studio
chart_studio.tools.set_credentials_file(
    username='136', # 这儿就不放我自己的账号和api了
    api_key='gtjvKKSBjnOLte86BmiR'
    )

import plotly.plotly as py
import plotly.figure_factory as ff

import numpy as np

X = np.random.rand(15, 15)
dendro = ff.create_dendrogram(X)
dendro['layout'].update({'width': 800, 'height': 500})
py.plot(dendro, filename='simple_dendrogram')

import pandas as pd
data = pd.read_csv(r'C:\Users\鲍超\Desktop\小论文——基于在线评论的物流客户满意度研究\杂\data.csv')
X = data[["特征值1","特征值2"]]
fig = ff.create_dendrogram(X, orientation='left',labels=list(data["名词"]))
fig['layout'].update({'width':800, 'height':800})
py.plot(fig, filename='dendrogram_with_labels')
